create proc proc_insert
@username varchar(10),
@name varchar(10),
@pwd varchar(10),
@type int
as
insert into UserInfo values(@username,@name,@pwd,@type)
go
create proc proc_del
@id int
as
delete from UserInfo where UserId=@id
go
create proc proc_edit
@id int,
@username varchar(10),
@name varchar(10),
@pwd varchar(10),
@type int
as
update UserInfo set LoginName=@username,TureName=@name,Password=@pwd,Role=@type where UserId=@id
go
create proc proc_searchbytype
@type int,
@count int output
as
select @count=count(*) from UserInfo where Role=@type
go
declare @count int;
exec proc_count @count output
print @count
select * from UserInfo

